FROM --platform=$TARGETPLATFORM registry.cn-zhangjiakou.aliyuncs.com/publicx/debian:11.7

COPY --from=registry.cn-zhangjiakou.aliyuncs.com/publicx/kafka-console-ui-archive:1.0.9 /kafka-console-ui-1.0.9.tar.gz /

RUN tar -xzf /kafka-console-ui-1.0.9.tar.gz

FROM --platform=$TARGETPLATFORM registry.cn-zhangjiakou.aliyuncs.com/publicx/oracle-jdk:8u381

MAINTAINER xuelingkang

LABEL by="https://github.com/xxd763795151/kafka-console-ui"

COPY --from=0 /kafka-console-ui /app
COPY --from=registry.cn-zhangjiakou.aliyuncs.com/publicx/gosu:1.16 /gosu /usr/bin/gosu
COPY docker-entrypoint.sh /usr/bin/docker-entrypoint.sh

WORKDIR /app

RUN mkdir -p /app/log /app/data && \
    chmod u+x /usr/bin/gosu /usr/bin/docker-entrypoint.sh && \
    ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && \
    echo "Asia/Shanghai" > /etc/timezone

EXPOSE 7766

ENTRYPOINT ["docker-entrypoint.sh"]

CMD ["java", "-Dsun.jnu.encoding=UTF-8", "-Dfile.encoding=UTF-8", "-Djava.security.egd=file:/dev/./urandom", "-Xms512m", "-Xmx512m", "-jar", "/app/lib/kafka-console-ui.jar", "--logging.home=/app/log", "--data.dir=/app/data"]

